package com.lwq.designpattern.creationalPatterns.singletonPattern;

/**
 * @ClassName 单例模式（饱汉 饿汉）
 * @Description
 * @Author liwq
 * @Date 2021/4/25 13:41
 * @Version 1.0
 */
public class SingletonPatternDemo {
    public static void main(String[] args) {
        //饱汉
        SingletonLazy singletonLazy = SingletonLazy.getInstance();
        singletonLazy.showMessage();

        //饿汉
        SingletonHungry singletonHungry = SingletonHungry.getInstance();
        singletonHungry.showMessage();
    }
}
